package com.hqq.action.state.state;


/**
 * StateTest
 * 状态模式
 * 当对象的状态改变时，同时改变其行为
 * Created by heqianqian on 2017/3/11.
 */
public class StateTest {
    public static void main(String[] args) {
        State state1 = new State("state1");

        Context context = new Context(state1);
        context.method();

        state1.setValue("state2");
        context.method();
    }
}
